#pragma once
#include "mytypes.h"

namespace poly
{
	// represents a non-selfintersecting line strip
	class PolyLine : public std::vector<float3>
	{
	public:
		PolyLine transform( float44 const & ) const;
		float length() const;
		float3 center() const;
		float33 momentOfInertia() const;

		struct ClosestPointDesc
		{
			float3 point;
			float3 tangent;
			
			enum PointType
			{
				VERTEX, // on vertex
				SEGMENT // on segment
			};

			PointType type;
		};

		// returns a vector pointing from pos to the nearest point on PolyLine
		ClosestPointDesc closestPoint( float3 const & pos );
	};
}
